package com.util;

import java.sql.Connection;
import java.sql.DriverManager;

public class DBUtil {
	private static final String DRIVERNAME="com.mysql.jdbc.Driver";
	private static final String URL="jdbc:mysql://localhost:3306/scott";
	private static final String USERNAME="root";
	private static final String PASSWORD="";
	
	public Connection getConnection(){
		Connection con=null;
		try {
			Class.forName(DRIVERNAME);
			con=DriverManager.getConnection(URL,USERNAME,PASSWORD);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return con;
	}
}
